<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="Public/breadcrumb"/>
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 结算中心</h3>
        </div>
        <div class="panel-body">    
            
<div class="navbar navbar-default">                                   
        <div class="form-group">
            <!--<p class="text-warning">待结算资金:{$store.pending_money}</p>-->
            <p class="text-warning" style="text-align: center;line-height:55px;font-size: 18px;">订单金额 : <b style="color: red;">{$store.store_money}</b> 元 - 退货金额 : <b style="color: green;">{$tuihuo}</b> 元 - 手续费 : <b style="color: green;">
                <!--{:(($store['store_money']-$tuihuo) * 0.005)}-->0
            <!--</b> 元  = 实收金额 :<b style="font-size: 22px;color: red;">{:($store['store_money'] - (($store['store_money']-$tuihuo) * 0.005)-$tuihuo)}</b>元</p>-->
            </b> 元  = 实收金额 :<b style="font-size: 22px;color: red;">{:($store['store_money'] - $tuihuo)}</b>元</p>
			 <p style="text-align: center;font-size:15px;color:#f39c12">每周二系统自动兑现结款，请留意结算记录。<a href="{:U('Finance/add_edit_withdrawals')}"><button class="btn btn-primary" id="button-filter search-order" type="button"><i class="fa fa-edit"></i> 添加银行资料</button></a></p>
        </div>                                                                     
</div>            
            
		<div class="navbar navbar-default">                    
                <form id="search-form2" class="navbar-form form-inline"  method="get" >
                <div class="form-group" style="color: green;">    
                    以下是最新20条结算记录。 <a href="/index.php/Seller/Finance/order_statis">查看结算记录</a>
                </div>                                 
                </form>                            
          </div>
                        
          <div id="ajax_return"> 
                 
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th class="sorting text-left">ID</th>
<!--                                <th class="sorting text-left">退货扣除</th>
								<th class="sorting text-left">平台扣除</th> -->
                                <th class="sorting text-left">银行名称</th>
                                <th class="sorting text-left">银行账号</th>
                                <th class="sorting text-left">开户人</th>
								<th class="sorting text-left">结算金额</th>
								<th class="sorting text-left">退货金额</th>
                                <th class="sorting text-left">手续费</th>
								<th class="sorting text-left">应付金额</th>
                                <th class="sorting text-left">状态</th>
								<th class="sorting text-left">结算时间</th> 
                                <th class="sorting text-left">备注</th>
                                <!-- <th class="sorting text-left">操作</th> -->
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="list" id="v">
                                <tr>
                                    <td class="text-left">{$v.id}</td>                                   
<!--                                    <th class="sorting text-left">{$v.kmoney}</th>
									<th class="sorting text-left">{$v.pkmoney}</th> -->
                                    <td class="text-left">{$v.bank_name}</td>
                                    <td class="text-left">{$v.account_bank}</td>
                                    <td class="text-left">{$v.account_name}</td>
									<td class="text-left" style="color:red;">{$v.money}
									<a href="javascript:" id="chakan" rev="order_statis_shouhuo" style="float: right;" rel="{$v.id}" class="fa fa-eye">明细</a>
                                    </td>
									<td class="text-left" style="color: green;">-{$v.th_money}
									<a href="javascript:" id="chakan" rev="order_statis_tuihuo" style="float: right;" rel="{$v.id}" class="fa fa-eye">明细</a>
                                    </td>
									<td class="text-left" style="color: blue;">{$v.sxf_money}</td>
									<td class="text-left" style="color: red;">{$v.yf_money}</td>
                                    <td class="text-left" style="color: green;">
                                        <if condition="$v[status] eq 0">结算中</if>                                        
                                        <if condition="$v[status] eq 1">结算成功</if>
                                        <if condition="$v[status] eq 2">结算失败</if>
                                    </td>
									<td class="text-left">{$v.create_time|date="Y-m-d",###}</td>
                                    <td class="text-left">{$v.remark}</td>
                                </tr>
                            </volist>
							<tr>
								<td colspan="4" align="right"><b>合计：</b></td>
								<td style="font-size: 15px;color: red;">{$hejiprice}</td>
								<td style="font-size: 15px;color: green;">-{$tuihuo_heji}</td>
								<td style="font-size: 15px;color: blue;">-{$shouxufei_heji}</td>
								<td style="font-size: 15px;color: red;">{:sanwei($hejiprice-$tuihuo_heji-$shouxufei_heji)}</td>
							</tr>
                            </tbody>
                        </table>
                    </div>
                
                <div class="row">
                    <div class="col-sm-6 text-left"></div>
                    <div class="col-sm-6 text-right">{$show}</div>
                </div>
          
          </div>
        </div>
      </div>
    </div>
    <!-- /.row --> 
  </section>
  <!-- /.content --> 
</div>
<!-- /.content-wrapper --> 
 <script>
 // 删除操作
// function del(id)
// {
// 	if(!confirm('确定要删除吗?'))
// 		return false;		
// 		$.ajax({
// 			url:"/index.php?m=Seller&c=Finance&a=delWithdrawals&id="+id,
// 			success: function(v){	
//                             var v =  eval('('+v+')');                                 
//                             if(v.hasOwnProperty('status') && (v.status == 1))
//                                location.href='{:U('Finance/withdrawals')}';
//                             else                                
// 			        layer.msg(v.msg, {icon: 2,time: 1000}); //alert(v.msg);
// 			}
// 		}); 
// 	 return false;
// }
 
$(document).ready(function() {
	$('#start_time').daterangepicker({
		format:"YYYY-MM-DD",
		singleDatePicker: false,
		showDropdowns: true,
		minDate:'2020-01-01',
		maxDate:'2030-01-01',
		startDate:'2020-01-01',
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});
	
$(".table-responsive #chakan").click(function(){
		var myrel=$(this).attr('rel');
		var mytype=$(this).attr('rev');
		var myrul='/index.php/Seller/Finance/'+mytype+'/id/'+myrel;
			layer.open({
			  type: 2,
			  title:'结算明细',
			  shadeClose: true,
			  skin: 'layui-layer-rim', 
			  area: ['920px', '620px'], 
			  content: myrul,
		});
    });
});

</script>
</body>
</html>